<style>

</style>
<body>
    <div id="msg"></div>
    <div id="input">
        <textarea name="" id="txt" cols="30" rows="10"></textarea>
        <input type="button" value="发送" id="send">
    </div>
</body>

    <script>
   var omsg = document.getElementById('msg')
   var otxt = document.getElementById('txt')
   var osend = document.getElementById('send')

   osend.onclick = function(){
    var p = document.createElement('p')
    p.innerHTML = otxt.value;
    omsg.appendChild(p)
    otxt.value='';
    
   }
   
   otxt.onkeydown = function(eve){
    var p = document.createElement('p')
    p.innerHTML = otxt.value;
    omsg.appendChild(p)
    otxt.value='';
    if(code===13 && e.ctrlKey){
   send()
    }


    //禁用默认功能

   }
</script>